package com.example.demo.repository;

import com.example.demo.mongoDb.Comment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author xiao
 * @Date 2025/5/7 上午 9:53
 * @ClassName: CommentRepository
 * @Desc:
 */
@Repository
public interface CommentRepository extends MongoRepository<Comment,String> {
    /**
     * 根据文章id获取评论
     *
     * @param articleid
     */
    List<Comment> findCommentByArticleid(String articleid);

    /**
     * 根据parentId分页查询
     *
     * @param parentid
     * @param pageable
     */
    Page<Comment> findCommentListByParentid(String parentid, Pageable pageable);
}
